﻿#if SRP_URP
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;

namespace GameToolkit
{
    /// <summary>
    /// 资源缓存
    /// </summary>
    public interface ICacheableVolumeComponent
    {
        void ReleaseCacheableAssets();
    }

    public interface ICustomVolumePassQueue
    {
        TPass Enqueue<TPass>(BaseVolumeComponent com, RenderPassEvent renderEvevnt, int sortOrder)
            where TPass : ScriptableRenderPass, new();
    }

    public abstract class BaseVolumeComponent : VolumeComponent, IPostProcessComponent
    {
        public virtual bool IsActive()
        {
            var args = parameters;
            var len = args == null ? 0 : args.Count;
            for (int i = 0; i < len; i++)
            {
                if (parameters[i].overrideState)
                    return true;
            }
            return false;
        }

        public virtual bool IsRenderPassDirty()
        {
            return false;
        }

        public virtual bool IsTileCompatible()
        {
            return true;
        }
        public abstract void OnActivite(CustomVolumeRenderer volr);
        public abstract void OnSetupVolumePasses(CustomVolumeRenderer volr);
        public abstract void OnDeactivite(CustomVolumeRenderer volr);
    }

}
#endif